Actions After Add, Edit, Save

Redirect to Another Page when Show or Edit Record Page Cannot Retrieve Data

Description
This customization shows how to redirect to another page when Show or Edit Record page cannot retrieve data.
Variables
Record Control
Select the record control class which will contain the customization
Applies to
RecordControl class
Code
 
/// 
/// Overrides the default behaviour of LoadData.
/// 
public override void LoadData()
{
		  
	// Call base.LoadData()
	base.LoadData();
	if (this.DataSource == null)
	{
		// If no records found then, redirect to the page of your choice
		this.Page.Response.Redirect("../OtherPages/SomeOtherPage.aspx");
	}
   
}
   

Terms of Service Privacy Statement